package java_0629;

public class ThreadDemo9 {
    public static void main(String[] args) {
        Thread t = new Thread("myThread"){
            @Override
            public void run() {
                while(true){
                    System.out.println(Thread.currentThread().getName());
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

            }
        };
        t.start();
        System.out.println("id: "+t.getId());
        System.out.println("name: "+t.getName());
        System.out.println("state: "+t.getState());
        System.out.println("priority: "+t.getPriority());
        System.out.println("isDaemon: "+t.isDaemon());
        System.out.println("isInterrupted: "+t.isInterrupted());
        System.out.println("isAlive: "+t.isAlive());
    }

}
